package com.corticon.dialogs.dao.hibernate;

import org.springframework.stereotype.Repository;

import com.corticon.dialogs.dao.QuestionSetInNaireDAO;
import com.corticon.dialogs.model.Questionnaire;
import com.corticon.dialogs.model.QuestionSetInNaire;

@Repository("questionSetInNaireDAO")
public class QuestionSetInNaireHibernateDAO extends GenericHibernateDAO<QuestionSetInNaire, Long>
    implements QuestionSetInNaireDAO {

    @Override
    public QuestionSetInNaire findByQuestionnaireAndSequence(Questionnaire qn, String seq) {
        return (QuestionSetInNaire) getSession().getNamedQuery(
            "QuestionSetInNaire.findByQuestionnaireAndSequence").setEntity("qn", qn).setString("seq",
            seq).uniqueResult();
    }
}